<?php

class Official_function_model extends CI_Model {

    function OfficialFunctionModel() {
        parent::Model();
    }

    function checkExistingOfficialFunction($officialNumberToCheck) {
        $query = $this->db->get_where('Officer_Order', array('Order_Number' => check_post('Order_Number')));
        if (!$query->num_rows) {
            $this->db->insert('Officer', array(
                'function_ID' => check_post('status'),
                'name' => check_post('name'),
                'note' => check_post('note')
            ));
            combine_session('success', 'បន្ថែមមន្ត្រីថ្មីបានជោគជ័យ.');
        }
    }

}

?>